package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.ProjectPlan;
import com.ruoyi.system.mapper.ProjectPlanMapper;
import com.ruoyi.system.service.ProjectPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProjectPlanServiceImpl implements ProjectPlanService
{
    @Autowired
    private ProjectPlanMapper projectPlanMapper;

    /**
     * 查询项目转化（计划）
     *
     * @param planId 项目转化（计划）主键
     * @return 项目转化（计划）
     */
    @Override
    public ProjectPlan selectProjectPlanByPlanId(Long planId)
    {
        return projectPlanMapper.selectProjectPlanByPlanId(planId);
    }

    /**
     * 查询项目转化（计划）列表
     *
     * @param projectPlan 项目转化（计划）
     * @return 项目转化（计划）
     */
    @Override
    public List<ProjectPlan> selectProjectPlanList(ProjectPlan projectPlan)
    {
        return projectPlanMapper.selectProjectPlanList(projectPlan);
    }

    /**
     * 新增项目转化（计划）
     *
     * @param projectPlan 项目转化（计划）
     * @return 结果
     */
    @Override
    public int insertProjectPlan(ProjectPlan projectPlan)
    {
        projectPlan.setCreateTime(DateUtils.getNowDate());
        return projectPlanMapper.insertProjectPlan(projectPlan);
    }

    /**
     * 修改项目转化（计划）
     *
     * @param projectPlan 项目转化（计划）
     * @return 结果
     */
    @Override
    public int updateProjectPlan(ProjectPlan projectPlan)
    {
        return projectPlanMapper.updateProjectPlan(projectPlan);
    }

    /**
     * 批量删除项目转化（计划）
     *
     * @param planIds 需要删除的项目转化（计划）主键
     * @return 结果
     */
    @Override
    public int deleteProjectPlanByPlanIds(Long[] planIds)
    {
        return projectPlanMapper.deleteProjectPlanByPlanIds(planIds);
    }

    /**
     * 删除项目转化（计划）信息
     *
     * @param planId 项目转化（计划）主键
     * @return 结果
     */
    @Override
    public int deleteProjectPlanByPlanId(Long planId)
    {
        return projectPlanMapper.deleteProjectPlanByPlanId(planId);
    }
}

